<?php
	class SubwayAction extends Action{
		public function index(){
			if(!$this->isPost()){
				$friend_link = M('friendurl')->select();
				//print_r($friend_link);exit;
				$this->assign("furl",$friend_link);
				
				//头部图片
				$topimg = M("advertising")->where("place=1")->order('id desc')->limit('1')->select();
				$this->assign("topimg",$topimg);
				
				$this->display();
			}else{
				$id = intval($_POST['id']);
				$sub = M('subway')->where('s_id='.$id)->select();
				$this->assign("sub",$sub);
				$S1_1 = M("xiezilou")->where("x_subway=$id")->field("COUNT(x_id) as num,x_name,x_id")->group("x_name")->select();
				$this->assign("s1_1",$S1_1);
				$S1_2 = M("shangpu")->where("s_subway=$id")->field("COUNT(s_id) as num,s_name,s_id")->group("s_name")->select();
				$this->assign("s1_2",$S1_2);
				$this->display("houses");
			}
		}
	}
?>